﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forest.Cat.Domain.Entities;
using Forest.Core;
using Forest.Cat.Domain.Shared;
using Forest.Cat.Domain.Entities.Messages;

namespace Forest.Cat.Domain.Services.Catalog
{
    public partial interface IJobPositionService
    {
        void DeleteJobPosition(JobPosition jobposition);

        JobPosition GetJobPositionById(Guid jobpositionId);

        IPagedList<JobPosition> GetAllJobPositions(int pageIndex, int pageSize);

        void InsertJobPosition(JobPosition jobposition);

        void UpdateJobPosition(JobPosition jobposition);

        IList<JobPosition> GetHotJobList();

        /// <summary>
        /// 检索Job一览(前台)
        /// </summary>
        /// <param name="jobTitle"></param>
        /// <param name="companyName"></param>
        /// <param name="lovType"></param>
        /// <param name="lovValue"></param>
        /// <returns></returns>
        IQueryable<JobPosition> FindJobList(String jobTitle, String companyName, JobListOrderMode orderMode, String lovCondition = null);

        /// <summary>
        /// 获取职位的分页列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        IPagedList<JobPosition> GetJobPagedList(int pageIndex, int pageSize, IQueryable<JobPosition> query);

        IQueryable<JobPosition> AdvSearchJobList(String keyWord,
           int? industry1,
           int? industry2,
           int? jobCategory1,
           int? jobCategory2,
           String educationLevelString,
           String jobTypeString,
           int? companyType,
           int? postedDate,
           JobListOrderMode orderMode,
           String lovCondition = null);

        /// <summary>
        /// 获取职位相关Lov列表
        /// </summary>
        /// <param name="jobTitle"></param>
        /// <param name="companyName"></param>
        /// <param name="lovType"></param>
        /// <returns></returns>
        IList<LovInfoForSearchListView> GetLovInfoList(String jobTitle, String companyName, LovType lovType, JobListOrderMode orderMode, String lovCondition);

        /// <summary>
        /// 获取职位相关Lov列表
        /// </summary>
        /// <param name="keyWord"></param>
        /// <param name="industry1"></param>
        /// <param name="industry2"></param>
        /// <param name="jobCategory1"></param>
        /// <param name="jobCategory2"></param>
        /// <param name="educationLevelString"></param>
        /// <param name="jobTypeString"></param>
        /// <param name="companyType"></param>
        /// <param name="postedDate"></param>
        /// <param name="lovType"></param>
        /// <returns></returns>
        IList<LovInfoForSearchListView> GetLovInfoList(String keyWord,
            int? industry1,
            int? industry2,
            int? jobCategory1,
            int? jobCategory2,
            String educationLevelString,
            String jobTypeString,
            int? companyType,
            int? postedDate,
            LovType lovType,
            JobListOrderMode orderMode,
            String lovCondition);

        /// <summary>
        /// 获取公司的职位一览
        /// </summary>
        /// <param name="companyId"></param>
        /// <returns></returns>
        IQueryable<JobPosition> GetJobListByCompanyId(Guid companyId);

        /// <summary>
        /// 获取和传入的职位相同行业的职位列表(排除传入的职位)
        /// </summary>
        /// <param name="jobId"></param>
        /// <returns></returns>
        IQueryable<JobPosition> GetRelatedJobList(Guid jobId);

        /// <summary>
        /// 根据访问记录获取职位信息
        /// </summary>
        /// <param name="jobIdList"></param>
        /// <returns></returns>
        IQueryable<JobPosition> GetJobsRelatedByViewdHistory(IEnumerable<Guid> jobIdList);

        /// <summary>
        /// 获取和求职人相关的职位信息
        /// </summary>
        /// <param name="jobSeekerId"></param>
        /// <returns></returns>
        IQueryable<JobPosition> GetJobsRelatedByJobSeeker(Guid jobSeekerId);

        /// <summary>
        /// 查询显示首页的列表
        /// </summary>
        /// <returns></returns>
        IQueryable<JobPosition> GetAdminIndexList(Guid jobSeekerId);

        /// <summary>
        /// 获取当前人员收到的企业来信
        /// </summary>
        /// <param name="jobseekerId"></param>
        /// <returns></returns>
        IQueryable<ReceivedMessage> GetReceivedMessageList(Guid jobseekerId);

        IList<JobPosition> GetJobsBySource(JobSource jobSource, int top = 10);
    }
}
